package ppl.tut1

import scala.collection.mutable.ArrayBuffer

class UniformElement(c: Char, row: Int, col: Int) extends Element {

   def makeString: String = {
      var str = ""
      for (i <- 1 to col) {
         str += c.toString
      }
      return str
   }

   val str = makeString

   def makeArray: Array[String] = {
      var buf = new ArrayBuffer[String]
      for (i <- 1 to row) {
         buf += str
      }
      return buf.toArray
   }

   def contents: Array[String] = makeArray
}